/**
 * Created by baidm in 2022/5/4 on 10:16
 */
class EchartsUtil {
    constructor() {

    }

    getBarWith3DSeries({name, data,textStyle}) {
        return [
            {
                name: `${name}`,
                type: "bar",
                showSymbol: false,
                hoverAnimation: false,
                data,
                barWidth: 10,
                itemStyle: {    //左面
                    normal: {
                        color: "#1bb3d5",
                        barBorderRadius: [4, 0, 0, 100],
                    }
                }
            },
            {
                // name: `r`,
                tooltip: {
                    show: true
                },
                type: 'bar',
                barWidth: 10,
                itemStyle: {    //右面
                    normal: {
                        color: "#1bb3d5",
                        borderWidth: 0.1,
                        barBorderRadius: [0, 5, 100, 0]
                    }
                },
                data,
                barGap: 0
            },
            {
                // name: `t`,
                tooltip: {
                    show: false
                },
                type: 'pictorialBar',
                itemStyle: {    //顶部
                    normal: {
                        color: "#1bb3d5",
                        borderColor: '#000',
                        borderWidth: 0.1,
                        label: {
                            show: true,
                            position: 'top',
                            textStyle,
                            offset: [0, -2]
                        }
                    }
                },
                symbol: 'diamond',
                symbolSize: ['20.5', '13'],
                symbolOffset: [0, '-38%'],
                symbolPosition: 'end',
                data,
                z: 3
            },
            {
                // name: `b`,
                tooltip: {
                    show: false
                },
                type: 'pictorialBar',
                itemStyle: {    //底部
                    normal: {
                        color: "#1bb3d5",
                        borderColor: '#000',
                        borderWidth: 0.1,
                        label: {
                            show: false,
                            position: 'top',
                            textStyle,
                            offset: [0, -2]
                        }
                    }
                },
                symbol: 'diamond',
                symbolSize: ['20.5', '17'],
                symbolOffset: [0, '2.5'],
                symbolPosition: 'start',
                data,
                z: 0
            }
        ]
    }


}

export default new EchartsUtil()